﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Iacym.Entities;
using Iacym.BusinessLogic;
using Microsoft.Practices.Unity;

namespace Iacym.UI
{
    public partial class FrmInputDialog : Form
    {
        [Dependency]
        public IOfrendaBL ofrendaBL { get; set; }

        public FrmInputDialog()
        {
            InitializeComponent();
            this.BuildUp();
        }

        public OFRENDA current { get; set; }

        private void FrmInputDialog_Load(object sender, EventArgs e)
        {
            oFRENDABindingSource.DataSource = current;
        }

        private void BtnGuardar_Click(object sender, EventArgs e)
        {
            current.Anulado = true;
            current.Motivo = motivoTextBox.Text.ToUpper();
            ofrendaBL.UpdateOfrenda(current);
            MessageBox.Show("Ofrenda anulada correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Close();
        }
    }
}
